package com.orangecy.common.result;

import lombok.Data;

/**
 * @Author : orangeCy.奕
 * @Time : 2021/9/12
 * @desc : 猎豹养成产品源码
 */
@Data
public class PlainResult<T> {
    private boolean success = Boolean.TRUE;
    private int code;
    private String msg;
    private T data;

    public static <E> PlainResult<E> create(){
        return new PlainResult<E>();
    }

    public static <E> PlainResult<E> createFailed(String errMsg) {
        PlainResult<E> result = new PlainResult<E>();
        result.setSuccess(false);
        result.setMsg(errMsg);
        return result;
    }

    public boolean isSuccess() {
        return success;
    }

    //需要再加。。

}